The present invention relates to a method, a device, and a computer program for merge-sorting record groups having a tree structure efficiently by attaching depth information as metadata, indicative of the hierarchical depth of the tree structure.
When record groups having a tree structure are merge-sorted in descending or ascending order, it is necessary to compare records sequentially record by record, which leads to relatively high computational processing load. Conventionally, an effort to pay attention to a tree structure to perform operations on the tree structure using a pointer or perform random access to a memory has been made in order to reduce the time required for the merge sort.
For example, Japanese Patent Application Publication No. 2013-143040 discloses a table processing method in which, when records included in different tables are merge-sorted, since the records have a tree structure, link information to each tree is utilized to improve the computational processing efficiency. PCT International Publication No. WO 2010/106680 discloses a tree generation device which associates one tag key with one node when generating a tree, and uses the tag key to narrow down a node region that is a comparison target when performing a retrieval process or the like in order to reduce the retrieval time.
PCT International Publication No. WO 2013/108333 discloses a search device in which previous search path information indicating a hierarchical node corresponding to a target sequence is stored and a search with a search condition the beginning of which matches that of the previous search condition is performed by limiting the search range to speed up the search.